var app = angular.module('smogApp', [ 'ui.utils', 'ngTable' ]).controller(
		'Smog',
		function($scope, $http, ngTableParams) {
			$http.get('http://odin.htwsaar.de:8080/measurements/all').success(
					function(data) {
						// var data = angular.fromJson(data);
						// $scope.measurements = data;

						$scope.measurements = angular.fromJson(data);
						$scope.data = $scope.measurements;

						$scope.tableParams = new ngTableParams({
							page : 1, // show first page
							count : 10
						// count per page
						}, {
							total : $scope.measurements.length, // length of
																// data
							getData : function($defer, params) {
								params.total($scope.measurements.length);
								$defer.resolve($scope.measurements.slice(
										(params.page() - 1) * params.count(),
										params.page() * params.count()));
							}

						});

					});

		});